package a.e;

import javax.imageio.IIOImage;
import javax.imageio.ImageIO;
import javax.imageio.ImageWriteParam;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageOutputStream;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
import java.util.Locale;

public class m
  extends k
{
  private ImageWriter g;
  private ImageWriteParam h;
  private boolean i;
  public static boolean j;
  
  public m(ImageWriter paramImageWriter)
  {
    a(paramImageWriter);
  }
  
  public boolean i()
  {
    return this.i;
  }
  
  public void c(boolean paramBoolean)
  {
    this.i = paramBoolean;
  }
  
  public void a(ImageWriter paramImageWriter)
  {
    int k = e.b;
    if (k == 0)
    {
      if (paramImageWriter == null) {
        throw new NullPointerException();
      }
      if (k != 0) {}
    }
    else
    {
      if (this.g == paramImageWriter) {
        return;
      }
      this.g = paramImageWriter;
    }
    this.h = paramImageWriter.getDefaultWriteParam();
  }
  
  public ImageWriter j()
  {
    return this.g;
  }
  
  protected void a(BufferedImage paramBufferedImage, OutputStream paramOutputStream)
    throws IOException
  {
    a(this.g, paramBufferedImage, paramOutputStream, k());
  }
  
  public String b()
  {
    int k = e.b;
    String[] arrayOfString = this.g.getOriginatingProvider().getFileSuffixes();
    if ((k != 0) || (arrayOfString != null)) {
      if (k != 0) {
        break label39;
      }
    }
    label39:
    return arrayOfString.length < 1 ? "bin" : arrayOfString[0];
  }
  
  public String a()
  {
    return this.g.getOriginatingProvider().getDescription(Locale.getDefault());
  }
  
  protected BufferedImage a(int paramInt1, int paramInt2)
  {
    if (i()) {
      return new BufferedImage(paramInt1, paramInt2, 2);
    }
    return new BufferedImage(paramInt1, paramInt2, 1);
  }
  
  public ImageWriteParam k()
  {
    return this.h;
  }
  
  public void a(ImageWriteParam paramImageWriteParam)
  {
    if (paramImageWriteParam == null) {
      throw new NullPointerException();
    }
    this.h = paramImageWriteParam;
  }
  
  static void a(ImageWriter paramImageWriter, BufferedImage paramBufferedImage, OutputStream paramOutputStream, ImageWriteParam paramImageWriteParam)
    throws IOException
  {
    ImageOutputStream localImageOutputStream = ImageIO.createImageOutputStream(paramOutputStream);
    try
    {
      paramImageWriter.setOutput(localImageOutputStream);
      paramImageWriter.write(null, new IIOImage(paramBufferedImage, null, null), paramImageWriteParam);
    }
    finally
    {
      localImageOutputStream.close();
    }
  }
  
  static ImageWriter c(String paramString)
  {
    Iterator localIterator = ImageIO.getImageWritersByFormatName(paramString);
    if ((e.b != 0) || (localIterator.hasNext())) {
      return (ImageWriter)localIterator.next();
    }
    return null;
  }
  
  static String d(String paramString)
  {
    return System.getProperty("java.vm.vendor") + " " + System.getProperty("java.vm.name") + " " + System.getProperty("java.vm.version") + " for Java " + System.getProperty("java.version") + " does not support writing " + paramString + " format.";
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.e.m

 * JD-Core Version:    0.7.0.1

 */